<?php
/*
* Copyright (c) 2010 by Cediti
*
* You may distribute under the terms of either the GNU Lesser General
* Public License or the new BSD License, as specified in the README file.
*/
// created :	23 April 2010
// version :	23 April 2010

class Cmis_Repository_Acl_Ace
{
    /**
     * A principal represents a user management object, e.g. a user, group, or role.
     * String with the principalid
     * @var string
     */
    protected $_principal;

    /**
     * Name(s) of permissions
     * @var array[string]
     */
    protected $_names;

    /**
     * Flag which indicates if TRUE the ACE is directly assigned to the object.
     * If FALSE, that the ACE is somehow derived.
     * @var bool
     */
    protected $_direct;

    public function __construct($principal, $name, $direct)
    {
        if (!is_array($name))
        {
            $name = array($name);
        }

        $this->_names = $name;
        $this->_principal = $principal;
        $this->_direct = $direct;
    }

    public function getNames()
    {
        return $this->_names;
    }

    public function getPrincipal()
    {
        return $this->_principal;
    }

    public function getDirect()
    {
        return $this->_direct;
    }
}

# EOF
